<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%@ include file="/commons/commonList.jsp"%>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">

 var currentId="";
 var currentCoalitionId="";

   function openHouseDetail(){

   var url = "${ctx}/house_houseAction.do?method=initHouseDetailMain&keyword="+currentId;
		top.windowOpen(url, "houseDetail", "${key.room_detail}", 550, 750);
   }

   function setCurrentHouseId(houseId){
   currentId=houseId;
    parent.setCurrentHouseId(houseId);

   }

   function resize(){
		parent.window.document.all('connTabPanel').style.height=document.body.scrollHeight;

	}

   function setCurrentCoalitionId(coalitionId) {
     currentCoalitionId=coalitionId;
   }

    function openCoalitionHouse()
   {
   		var url = "${ctx}/house_coalitionHouseAction.do?method=initCoalitionHouseAdd";
		top.windowOpen(url, "houseChooses", "${key.add_room_join}", 350, 470,true,"houseChooses");
   }

   function editCoalitionHouse()
   {
   		if(currentCoalitionId != "")
   		{
	   	    var url = "${ctx}/house_coalitionHouseAction.do?method=initCoalitionHouseEdit&coalitionHouseId="+currentCoalitionId;
			top.windowOpen(url, "houseChooses", "${key.edit_room_join}", 350, 470,true,"houseChooses");
		}
		else
		{
			Alert("${key.alert_message1}");
		}
   }

    function deleteCoalitionHouse()
   {
   		if(currentCoalitionId != "")
   		{
	   	    var url = "${ctx}/house_coalitionHouseAction.do?method=initCoalitionHouseDelete&coalitionHouseId="+currentCoalitionId;
			top.windowOpen(url, "coalitionHouseDelete", "${key.delete_room_join}", 190, 350,true,"coalitionHouseDelete");
		}
		else
		{
			Alert("${key.alert_message2}");
		}
   }




</script>
</head>
<body onload="resize();">
<div    class="tab_bgline" >
<div style="overflow:auto; height:455px;">

	  <ec:ceTable items="HouseList"
	action="${ctx}/house_houseAction.do?method=housesList&buildingId=${buildingId}"
	var="houseItem"
	view="pmsview"
	styleClass="gridData2"
	rowsDisplayed="15" >
	<ec:ceRow styleClass="grid" onclick="setCurrentHouseId('${houseItem.keyword}');setCurrentCoalitionId('${houseItem.coalitionHouseId}');" ondblclick="openHouseDetail();"
	onContextMenu="return ShowContextMenu(event,'quick_rightmenu');">
		<ec:ceColumn headerCell="pmsHeadrCell" title="${key.floor}" property="floor" sortable="true" width="10%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="${key.coalitionNumber1}" property="coalitionNumber" width="10%"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="${key.houseNumber}" property="houseNumber" sortable="true" width="10%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="${key.apartment}" property="housePlanName" width="10%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="${key.construction_area}" property="buildSize" sortable="true" width="11%"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="${key.inner_area}" property="innerSize" sortable="true" width="11%"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="${key.room_states}" showTitle="false" property="statusName" width="10%" styleClass="align_left">
		${houseItem.statusName}
		<c:if test="${houseItem.renovation=='1'}">
		<img src="${ctx}/images/ico_shenpi_zong.gif"border="0" align="absbottom" alt="${key.room_repair}"/>
		</c:if>
		</ec:ceColumn>
		<ec:parameter name="houseNumber" value="${houseNumber}"></ec:parameter>
	</ec:ceRow>
</ec:ceTable>

 </div>
 </div>

<div id="quick_rightmenu" style="display:none;"  oncontextmenu="return false" class="quick_rightmenu"onMouseOver="MM_showHideLayers('quick_rightmenu')"  onMouseOut="MM_showHideLayers('quick_rightmenu')">
<table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg">

	<tr>
      <td><table width="100%" border="0" cellpadding="2" cellspacing="0">

     	  <tr>
		   <td class="hrpading"></td>
          </tr>
          <pms:AuthTag authName="house_houseAction.do?method=initialHouseAdd">
            <tr>
		  <td class="quickMenu_toolbarico"><a href="#"  onclick="parent.openHouseAdd();return false;"onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="${key.add_room}"/>&nbsp;${key.add}</a></td>
          </tr>
          </pms:AuthTag>
          <pms:AuthTag authName="house_houseAction.do?method=initialHouseEdit">
          <tr>
          <td class="quickMenu_toolbarico"><a href="#"  onclick="parent.openHouseEdit();return false;"onfocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" border="0" align="absbottom" alt="${key.edit}"/> ${key.edit}</a></td>
          </tr>
          </pms:AuthTag>
          <pms:AuthTag authName="house_houseAction.do?method=deleteHouse">
		  <tr>
          <td class="quickMenu_toolbarico"><a href="#"  onclick="parent.deleteHouse();return false;"onfocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" border="0" align="absbottom" alt="${key.delete}"/> ${key.delete}</a></td>
          </tr>
          </pms:AuthTag>
          <pms:AuthTag authName="house_houseAction.do?method=initHouseStatePage">
          <tr>
            <td class="quickMenu_toolbarico"><a href="#"  onclick="parent.openChangeHouseState();return false;" onFocus="this.blur()"><img src="${ctx}/images/house_fw_hb.gif" border="0" align="absbottom" alt="${key.edit_room_states}"/>&nbsp;${key.edit_room_states}</a></td>
          </tr>
          </pms:AuthTag>
          <pms:AuthTag authName="menu.nopage.coalitionHousManage">
          <tr>
            <td class="quickMenu_toolbarico"><a href="#" onMouseOver="show2menu('quick_rightmenu5',this,event,'quick_rightmenu')" onMouseOut="hidden2menu('quick_rightmenu5')"><img src="${ctx}/images/house_hb.gif" border="0" align="absbottom" alt="${key.join_management}"/>&nbsp;${key.join_management}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="${ctx}/images/ico_index_start1.gif" border="0" /></a></td>
          </tr>
          </pms:AuthTag>
          <pms:AuthTag authName="house_meterAction.do?method=initMeterMaintenanceList">
		    <tr>
            <td class="quickMenu_toolbarico"><a href="#"  onclick="parent.openEditMeter();return false;" onFocus="this.blur()"><img src="${ctx}/images/ico_biao.gif" border="0" align="absbottom" alt="${key.meter_edit}"/>&nbsp;${key.meter_edit}</a></td>
          </tr>
        </pms:AuthTag>

      </table></td>
    </tr>
  </table>
<script type="text/javascript">

	var div1=document.getElementById('quick_rightmenu');
	if(div1.getElementsByTagName("tr").length==2){
	div1.innerHTML="";
	}
</script>
</div>
</div>

<div id="quick_rightmenu5" class="quick_menu2" style="display:none;">
  <table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg" onMouseOver="showmy2menu('quick_rightmenu5')" onMouseOut="hidden2menu('quick_rightmenu5')">

       <tr>
      <td><table width="100%" border="0" cellpadding="2" cellspacing="0">
      <pms:AuthTag authName="house_coalitionHouseAction.do?method=initCoalitionHouseAdd">
        <tr>
		<td class="quickMenu_toolbarico"><a href="#"  onclick="parent.openCoalitionHouse();return false;"onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" alt="" width="16" height="16" border="0" align="absbottom"> ${key.add}</a></td>
        </tr>
        </pms:AuthTag>
        <pms:AuthTag authName="house_coalitionHouseAction.do?method=initCoalitionHouseEdit">
		<tr>
          <td class="quickMenu_toolbarico"><a href="#"  onclick="parent.editCoalitionHouse();return false;"onfocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" alt="" width="16" height="16" border="0" align="absbottom">${key.edit} </a></td>
          </tr>
        </pms:AuthTag>
        <pms:AuthTag authName="house_coalitionHouseAction.do?method=initCoalitionHouseDelete">
		  <tr>
		   <td class="hrpading"><table width="95%" border="0" align="left" cellpadding="0" cellspacing="0">
		     <tr><td class="quickMenu_line"></td></tr></table></td>
          </tr>

        <tr>
          <td class="quickMenu_toolbarico"><a href="#" onClick="parent.deleteCoalitionHouse();return false;" onFocus="this.blur()"><img src="${ctx}/images/ico_unchain.gif" alt="" width="16" height="16" border="0" align="absbottom">${key.delete_relation} </a></td>
          </tr>
      </pms:AuthTag>
      </table></td>
    </tr>
  </table>
</div>

</body>
</html>